<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<nav class="navbar navbar-expand-lg main-navbar" th:fragment="navbar">
    <form class="form-inline mr-auto">
        <ul class="navbar-nav mr-3">
<!--            <li><a href="#" data-toggle="sidebar" class="nav-link nav-link-lg"><i class="ion ion-navicon-round"></i></a></li>-->
        </ul>
    </form>
    <ul class="navbar-nav navbar-right">
        <li class="dropdown"><a href="#" data-toggle="dropdown" class="nav-link dropdown-toggle nav-link-lg">
            <i class="ion ion-android-person d-lg-none"></i>
            <div class="d-sm-none d-lg-inline-block">
                 你好，[[${session.loginUser.name}]]
            </div>
        </a>
            <div class="dropdown-menu dropdown-menu-right">
                <a href="profile"  class="dropdown-item has-icon" th:if="${session.loginUser.role != 'admin'}">
                    <i class="ion ion-android-person"></i> 我的资料
                </a>
                <a href="reset.html"  class="dropdown-item has-icon">
                    <i class="ion ion-locked"></i> 修改密码
                </a>
                <a href="logout" class="dropdown-item has-icon">
                    <i class="ion ion-log-out"></i> 退出登录
                </a>
            </div>
        </li>
    </ul>
</nav>

<div class="main-sidebar" th:fragment="sidebar">
    <aside id="sidebar-wrapper">
        <div class="sidebar-brand">
            <a>志愿汇系统</a>
        </div>
        <div class="sidebar-user">
            <div class="sidebar-user-picture">
                <img alt="image" th:src="${session.loginUser.img}">
            </div>
            <div class="sidebar-user-details">
                <div class="user-name" th:text="${session.loginUser.name}"></div>
                <div class="user-role">
                    <span th:if="${session.loginUser.role == 'admin'}" th:text="${'系统管理员 【'+session.loginUser.no+'】'}"></span>
                    <span th:if="${session.loginUser.role == 'student'}" th:text="${'学生 【'+session.loginUser.no+'】'}"></span>
                    <span th:if="${session.loginUser.role == 'teacher' and session.loginUser.isLeader != 1}" th:text="${'团支书 【'+session.loginUser.no+'】'}"></span>
                    <span th:if="${session.loginUser.role == 'teacher' and session.loginUser.isLeader == 1}" th:text="${'学院院长 【'+session.loginUser.no+'】'}"></span>
                    <span th:if="${session.loginUser.role == 'department'}" th:text="${'部门 【'+session.loginUser.no+'】'}"></span>
                </div>
            </div>
        </div>
        <ul class="sidebar-menu">
            <li class="menu-header" th:if="${session.loginUser.role != 'admin'}">
                基本信息
            </li>
            <li th:class="${currUri == 'profile' ? 'active' : ''}" th:if="${session.loginUser.role != 'admin'}">
                <a href="profile"><i class="ion ion-android-person"></i><span>我的资料</span></a>
            </li>
            <!--教师-->
            <li class="menu-header" th:if="${session.loginUser.role == 'teacher'}">
                志愿活动
            </li>
            <li th:class="${currUri == 'publish' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher'}">
                <a href="publish"><i class="ion ion-ios-compose"></i><span>发布</span></a>
            </li>
            <li th:class="${currUri == 'my-report' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher'}">
                <a href="my-report"><i class="ion ion-ios-paper"></i><span>我的活动</span></a>
            </li>
            <li th:class="${currUri == 'meetings' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher'}">
                <a href="meetings"><i class="ion ion-calendar"></i><span>活动安排</span>
                    <div class="badge badge-danger" th:if="${session.arrangeCount > 0}" th:text="${session.arrangeCount}"></div>
                </a>
            </li>
            <li th:class="${currUri == 'pass-meetings' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher'}">
                <a href="pass-meetings"><i class="ion ion-ios-bookmarks"></i><span>历史活动</span></a>
            </li>
            <li th:class="${currUri == 'trash' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher'}">
                <a href="trash"><i class="ion ion-trash-b"></i><span>回收站</span></a>
            </li>
                <li th:class="${currUri == 'messages' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher'}">
                <a href="messages"><i class="ion ion-chatbubble-working"></i><span>消息中心</span>
                    <div class="badge badge-danger" th:if="${session.messagesCount > 0}" th:text="${session.messagesCount}"></div>
                </a>
            </li>
            <li th:class="${currUri == 'leader-audit' ? 'active' : ''}" th:if="${session.loginUser.role == 'teacher' and session.loginUser.isLeader == 1}">
                <a href="leader-audit"><i class="ion ion-eye"></i><span>报告初审</span>
                    <div class="badge badge-danger" th:if="${session.waitFirstAudit > 0}" th:text="${session.waitFirstAudit}"></div>
                </a>
            </li>

            <!--部门-->
            <li th:class="${currUri == 'audit' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('教务')}">
                <a href="audit"><i class="ion ion-eye"></i><span>活动审核</span>
                    <div class="badge badge-danger" th:if="${session.waitFinalAudit > 0}" th:text="${session.waitFinalAudit}"></div>
                </a>
            </li>
            <li th:class="${currUri == 'pass' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('教务')}">
                <a href="pass"><i class="ion ion-checkmark-circled"></i><span>已过审核</span></a>
            </li>
            <li th:class="${currUri == 'report-statistics' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('教务')}">
                <a href="report-statistics"><i class="ion ion-stats-bars"></i><span>活动统计</span></a>
            </li>
            <li th:class="${currUri == 'wait-arrange' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('宣传')}">
                <a href="wait-arrange"><i class="ion ion-load-b"></i><span>等待排期</span>
                    <div class="badge badge-danger" th:if="${session.waitArrange > 0}" th:text="${session.waitArrange}"></div>
                </a>
            </li>
            <li th:class="${currUri == 'appointing' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('宣传')}">
                <a href="appointing"><i class="ion ion-happy"></i><span>开放预约</span></a>
            </li>
            <li th:class="${currUri == 'prepare-meeting' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('宣传')}">
                <a href="prepare-meeting"><i class="ion ion-cube"></i><span>准备活动</span>
                    <div class="badge badge-danger" th:if="${session.waitPrepare > 0}" th:text="${session.waitPrepare}"></div>
                </a>
            </li>
            <li th:class="${currUri == 'meeting-statistics' ? 'active' : ''}" th:if="${session.loginUser.role == 'department' and session.loginUser.name.contains('宣传')}">
                <a href="meeting-statistics"><i class="ion ion-podium"></i><span>活动统计</span></a>
            </li>

            <!--管理员-->
            <li th:if="${session.loginUser.role == 'admin'}" class="menu-header">用户管理</li>
            <li th:if="${session.loginUser.role == 'admin'}" th:class="${currUri == 'list-students' ? 'active' : ''}">
                <a href="list-students"><i class="ion ion-android-person"></i><span>学生管理</span></a>
            </li>
            <li th:if="${session.loginUser.role == 'admin'}" th:class="${currUri == 'list-teachers' ? 'active' : ''}">
                <a href="list-teachers"><i class="ion ion-person-stalker"></i><span>志愿委员管理</span></a>
            </li>
            <li th:if="${session.loginUser.role == 'admin'}" th:class="${currUri == 'list-departments' ? 'active' : ''}">
                <a href="list-departments"><i class="ion ion-pie-graph"></i><span>部门管理</span></a>
            </li>
            <li th:if="${session.loginUser.role == 'admin'}" th:class="${currUri == 'list-colleges' ? 'active' : ''}">
                <a href="list-colleges"><i class="ion ion-university"></i><span>团支书管理</span></a>
            </li>

            <!--学生-->
            <li th:if="${session.loginUser.role == 'student'}" class="menu-header">志愿活动</li>
            <li th:if="${session.loginUser.role == 'student'}" th:class="${currUri == 'appointing-meeting' ? 'active' : ''}">
                <a href="appointing-meeting"><i class="ion ion-flag"></i><span>活动大厅</span></a>
            </li>
            <li th:if="${session.loginUser.role == 'student'}" th:class="${currUri == 'my-appointment' ? 'active' : ''}">
                <a href="my-appointment"><i class="ion ion-checkmark-circled"></i><span> 我的预约</span></a>
            </li>
            <li th:if="${session.loginUser.role == 'student'}" th:class="${currUri == 'my-present' ? 'active' : ''}">
                <a href="my-present"><i class="ion ion-ios-list"></i><span> 活动记录</span></a>
            </li>

            <div class="p-3 mt-4 mb-4">
                <a href="logout" class="btn btn-danger btn-shadow btn-round has-icon has-icon-nofloat btn-block">
                    <i class="ion ion-log-out"></i>
                    <div>退出登录</div>
                </a>
            </div>
    </aside>
</div>

<footer class="main-footer" th:fragment="footer">
    <div class="footer-left">
        &copy; 版权所有 <div class="bullet"></div> <a href="http://xuewei.world"></a>
    </div>
    <div class="footer-right"></div>
</footer>
</body>
</html>